<!DOCTYPE html>
<html lang="zxx">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <link rel="icon" href="images/favicon.png">
    <title></title>

    <link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
    <link rel="stylesheet" href="../css/materialize.css">
    <link rel="stylesheet" href="../css/loaders.css">
    <link rel="stylesheet" href="../css/lightbox.css">
    <link rel="stylesheet" type="text/css" href="http://www.jq22.com/jquery/font-awesome.4.6.0.css">
    <link rel="stylesheet" href="../css/owl.carousel.min.css">
    <link rel="stylesheet" href="../css/owl.theme.default.min.css">
    <link rel="stylesheet" href="../css/style.css">
    <link rel="stylesheet" href="../css/layer.css">
</head>

<body>

<!-- navbar -->
<div class="navbar">
    <div class="container">
        <div class="row">
            <div class="col s9">
                <div class="content-left" onclick="javascript:history.back(-1);">
                    <i class="fa fa-chevron-left center"></i>
                </div>
            </div>

        </div>
    </div>

</div>
<!-- end navbar -->

<!-- sidebar -->

<!-- end sidebar -->

<!-- list -->
<div class="segments-page">
    <div class="pages-title">
        <h3>卖出记录</h3>
        <div class="line"></div>
    </div>
    <div class="container weui-content">
        <div class="weui-tab">
            <div class="weui-navbar" style=" top:110px; left:0; right:0; height:44px; background:#fff;">
                <a class="weui-navbar__item proinfo-tab-tit font-14 weui-bar__item--on" href="#tab1">发布中</a>
                <a class="weui-navbar__item proinfo-tab-tit font-14" href="#tab2">交易中</a>
                <a class="weui-navbar__item proinfo-tab-tit font-14" href="#tab3">交易完成</a>
            </div>
            <div class="weui-tab__bd proinfo-tab-con" style="padding-top:18px;">
                <div id="tab1" class="weui-tab__bd-item weui-tab__bd-item--active">
                    <div class="weui-panel jyjl" id="issuehtml">
                    </div>
                </div>
                <div id="tab2" class="weui-tab__bd-item" >
                    <div class="weui-panel jyjl" id="trading">
                      
                        
                    </div>
                </div>
                <div id="tab3" class="weui-tab__bd-item">
                    <div class="weui-panel jyjl" id="complete">
                        
                    </div>

                </div>
            </div>
        </div>

    </div>
</div>
<!-- end list -->

<script src="../js/jquery.min.js"></script>
<script src="../js/materialize.js"></script>
<script src="../js/numscroller.js"></script>
<script src="../js/lightbox.js"></script>
<script src="../js/owl.carousel.min.js"></script>
<script src="../js/main.js"></script>
<script src="../js/layer.js"></script>
<script src="../js/jquerysession.js"></script>
<script src="../js/jquery.md5.js"></script>
<script src="../js/index.js"></script>
<script src="../js/jquery-weui.min.js"></script>
<script>

    jQuery(function ($) {
        var OrderLiseUrl = 'Order/UserOrderLise';
        var OrderLise = api_request(OrderLiseUrl, 'GET');


	if(OrderLise.code==1 && OrderLise.data !='' ){
			var data= OrderLise.data;
			var issuehtml = "";//待支付
			var tradinghtml="";//支付完成
			var completehtml="";//交易失败
		for(var i=0;i<data.length;i++){
			var ls=data[i];
		
			var type=ls.patterntype == 0 ?'银行卡':'支付宝';
			var Moneystatus=ls.Moneystatus == 1 ?'已付款':'未付款';
			if(ls.status==1  && ls.sellType==1){
				issuehtml
						+= ''
						  + '   <div class="weui-panel__bd">'
						+ '     <div class="weui-media-box weui-media-box_text">'
						+ '     <h4 class="weui-media-box__title">到账金额<em class="num" >'+ls.total+'￥</em></h4>'
						+ '     <p class="weui-media-box__desc"  >求购金额：'+ls.Hangmoney+'￥  </p>'
						+ '     <p class="weui-media-box__desc"  style="display: inline;">挂卖单价：'+ls.unit_price+'￥  </p>'
						+ '     <p class="weui-media-box__desc" style="display: inline;">手续费：'+ls.sxf+'￥ </p>'
						+ '     <p class="weui-media-box__desc"  >支付方式：'+type+'</p>'
						+ '     <ul class="weui-media-box__info"> '
						+ '     <li class="weui-media-box__info__meta">发布时间：<em class="num">'+ls.add_time+'</em>'
						+ '     </li> '
						+ '     </ul> '
							+ ' </div>'
						 + '    </div>'
						;
			}
			if(ls.status==2  && ls.sellType==1 && ls.Moneystatus==2){
			tradinghtml
					+= ''
					  + '   <div class="weui-panel__bd">'
					+ '     <div class="weui-media-box weui-media-box_text">'
					+ '     <h4 class="weui-media-box__title">到账金额<em class="num" >'+ls.total+'￥</em></h4>'
					+ '     <p class="weui-media-box__desc"  >求购金额：'+ls.Hangmoney+'￥  </p>'
					+ '     <p class="weui-media-box__desc"  style="display: inline;">挂卖单价：'+ls.unit_price+'￥  </p>'
					+ '     <p class="weui-media-box__desc" style="display: inline;">手续费：'+ls.sxf+'￥ </p>'
					+ '     <p class="weui-media-box__desc" >支付方式：'+type+'</p>'
					+ '     <ul class="weui-media-box__info"> '
					+ '     <li class="weui-media-box__info__meta">下单时间：<em class="num">'+ls.order_time+'</em>'
					+ '     <li class="weui-media-box__info__meta">支付时间：<em class="num">'+ls.payment_time+'</em>'
					+ '     </li> '
					+ '     </ul> '
					+ '     <button class="button"  onclick="affirm('+ls.id+'); "><i class="fa fa-send"></i>确认无误,同意交易</button>'
					+ '     </div>'
					+ '      </div>'
					;
			}
			if(ls.status==3 && ls !=''){
			completehtml
					+= ''
					  + ' <div class="weui-panel__bd">'
					+ '   <div class="weui-media-box weui-media-box_text">'
					+ '      <h4 class="weui-media-box__title">到账金额<em class="num" >'+ls.total+'￥</em></h4>'
					+ '     <p class="weui-media-box__desc"  >求购金额：'+ls.Hangmoney+'￥  </p>'
					+ '     <p class="weui-media-box__desc"  style="display: inline;">挂卖单价：'+ls.unit_price+'￥  </p>'
							+ '     <p class="weui-media-box__desc" style="display: inline;">手续费：'+ls.sxf+'￥ </p>'
							+'<p></p>'
							+ '     <p class="weui-media-box__desc"  style="display: inline;">交易方式：'+type+'</p>'
									+ ' <p class="weui-media-box__desc"  style="display: inline;" >付款状态：'+Moneystatus+'</p>'
					+ '       <ul class="weui-media-box__info"> '
					+ '       <li class="weui-media-box__info__meta">发布时间：<em class="num">'+ls.add_time+'</em>'
					+ '       <li class="weui-media-box__info__meta">下单时间：<em class="num">'+ls.order_time+'</em>'
						+ '       <li class="weui-media-box__info__meta">完成时间：<em class="num">'+ls.payment_time+'</em>'
					+ ' </li> '
					+ ' </ul> '
					+ '  </div>'
					 + '  </div>'
					;
						}
			}
		
		var issuehtmllist = document.getElementById("issuehtml");
		issuehtmllist.innerHTML += issuehtml;
		
		var tradinghtmllist = document.getElementById("trading");
		tradinghtmllist.innerHTML += tradinghtml;
		var completelist = document.getElementById("complete");
		completelist.innerHTML += completehtml;
			}
  

   });
function affirm(Oid){
	  layer.open({
	    content: '确认收到？'
	    ,btn: ['确认', '稍等']
	    ,yes: function(index){
	var affirmUrlUrl = 'Order/affirmUrl?Oid='+Oid;
	var affirmUrl = api_request(affirmUrlUrl, 'GET');
if(affirmUrl.code==1){
	layer.open({
	    content: affirmUrl.data
	    , skin: 'msg'
	    , time: 1//2秒后自动关闭
	    , end: function () {
	      location.reload();
	    }
	});
}
		
	    }
	  });
}
</script>
</body>
</html>